<%@ page import="cn.fzhui.model.Student" %><%--
Created by IntelliJ IDEA.
User: fzhui
Date: 2020/12/8
Time: 13:47
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>添加学生</title>
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <style>
        * {
            margin: 0px;
            padding: 0px;
        }
    </style>
</head>
<body>
<div style="margin: 0 auto;width: 1024px">
    <%
        Student student = (Student) request.getAttribute("student");
    %>
    <div><h1 style="text-align: center">添加学生</h1></div>
    <form action="/edit" method="post">
        <input type="hidden" value="<%=student.getId()%>" name="id">
        <div class="row">
            <div class="col-lg-8 col-lg-offset-2">
                <div class="form-group">
                    <label>学号：
                    </label>
                    <input value="<%=student.getNumber()%>" name="number" type="text" class="form-control" id="number"
                           placeholder="请输入学号">
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-lg-8 col-lg-offset-2">
                <div class="form-group">
                    <label>姓名：</label>
                    <input value="<%=student.getName()%>" name="name" type="text" class="form-control" id="name"
                           placeholder="请输入姓名">
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-lg-8 col-lg-offset-2">
                <div class="form-group">
                    <label>性别：</label>
                    <select name="sex" class="form-control">
                        <option value="男" <% if (student.getSex().equals("男")) { %>selected=true<%}%>>男</option>
                        <option value="女" <% if (student.getSex().equals("女")) { %>selected=true<%}%>>女</option>
                    </select>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-lg-8 col-lg-offset-2">
                <div class="form-group">
                    <label>生日：</label>
                    <input value="<%=student.getBirthday()%>" name="birthday" type="date" class="form-control"/>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-lg-8 col-lg-offset-2">
                <div class="form-group">
                    <label>密码：</label>
                    <input value="<%=student.getPassword()%>" name="password" type="password" class="form-control"/>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-lg-8 col-lg-offset-2">
                <div class="form-group">
                    <label>年龄：</label>
                    <input value="<%=student.getAge()%>" name="age" type="number" class="form-control"/>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-lg-8 col-lg-offset-2">
                <div class="form-group">
                    <label>邮箱：</label>
                    <input value="<%=student.getEmail()%>" name="email" type="email" class="form-control"/>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-lg-8 col-lg-offset-2">
                <div class="form-group">
                    <label>备注：</label>
                    <textarea name="remark" class="form-control"><%=student.getRemark()%></textarea>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-lg-2"></div>
            <div class="col-lg-4">
                <a href="index.jsp" class="btn btn-default" style="width: 100%">返回</a>
            </div>
            <div class="col-lg-4">
                <input type="submit" value="保存" class="btn btn-success" style="width: 100%"/>
            </div>
            <div class="col-lg-2"></div>
        </div>
    </form>
</div>
</body>
</html>
